<template>
	<view>
		<view class="navi-bar" @click="goBack">
			<
		</view>
		<u-gap height="80" bgColor="#fff"></u-gap>
		<view class="long-list">
			<view class="long-item" @click="naviTo(l.id)" v-for="(l, i) in LongDetailsList" :key="i">
				<view class="long-image">
					<image :src="l.cover" mode=""></image>
				</view>
				<view class="long-info">
					<view class="info-name">
						{{l.title}}
					</view>
					<view class="info-sub">
						{{l.subtitle}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from '../../untils/http.js'
	
	const url = 'find/serial/list/'
	
	export default {
		data() {
			return {
				LongDetailsList:[]
			}
		},
		onLoad({
			id
		}) {
			this.getLongDetails(id)
		},
		created() {
			
		},
		methods: {
			getLongDetails(id) {
				http(url + id).then(res => {
					this.LongDetailsList = res.data
					console.log(this.LongDetailsList);
				})
			},
			goBack() {
				// 返回上一级并刷新当前页面
				this.$router.go(-1)
			},
			naviTo(id) {
				uni.navigateTo({
					url: '/pages/SerialContent/SerialContent?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss">
	* {
		box-sizing: border-box;
	}
	
	.navi-bar {
		position: fixed;
		padding-left: 10px;
		width: 750rpx;
		height: 80rpx;
		line-height: 80rpx;
		background-color: #fff;
		z-index: 1000;
	}
	
	.long-list {
		padding-bottom: 10px;
		width: 750rpx;
	}
	
	.long-item {
		margin: 8px;
		display: flex;
		width: 100%;
		height: 100rpx;
		
		.long-image {
			margin-right: 15px;
			margin-left: 5px;
			flex: 1.5;
			
			image {
				width: 100%;
				height: 100%;
				border-radius: 8px;
			}
		}
		
		.long-info {
			flex: 8.5;
			width: 100%;
			// display: flex;
			// flex-direction: column;
			// justify-content: space-between;
			
			.info-name {
				margin-top: 3px;
				width: 560rpx;
				font-size: 14px;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.info-sub {
				margin-top: 8px;
				font-size: 10px;
				color: #c1c1c1;
				width: 560rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}
	}
</style>
